<?php 
    session_start();
    if($_SESSION['uid']==""||$_SESSION['level']!=3){
		header("Location: ../exit.php");
		exit();
    }
    include('/tool/submitValidate.php');
	include('/tool/pdo.php');
    include('/bll/DormitoryManagementBLL.php');
    include('/class/dormitory-management.class.php');

    $action = isset($_POST['action']) ? $_POST['action'] : 0;
    $data = isset($_POST['data']) ? $_POST['data'] : null;
    
    $message=array();
    switch((int)$action){
        //移除权限
        case 1:
            $removeList=json_decode($data);
            if($removeList!=null){
                $dormitoryManagementBLL=new DormitoryManagementBLL();
                $message=$dormitoryManagementBLL->removeDormitoryManagementJurisdiction($removeList);
            }
            break;
        case 2:break;
        default:break;
    }

    echo json_encode($message,JSON_UNESCAPED_UNICODE);
?>